#ifndef __RFIDNFCLIB_H__
#define __RFIDNFCLIB_H__

#include <Arduino.h>

//#define		DEBUG_RFIDNFC

class RFIDNFCLib{
	public:
		uint8_t _UID[4];
		bool StartRFIDNFC(void);
		bool ConfigureSAM(void);
		bool Diagnose(void);
		uint8_t DetectTag(void);
		void PrintUIDTagDetected(void);

  // library-accessible "private" interface
	private:
		uint8_t dataRX[35];//Receive buffer.
		uint8_t dataTX[35];//Transmit buffer.
		// stores the UID (unique identifier) of a card.
		//uint8_t keyAccess[] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF } ;// stores the key or password.
		//uint8_t address = 0x04;//Address to read.
		uint8_t ATQ[2];//Answer to request
		uint8_t state;//state of the process
		uint8_t aux[16];//Auxiliar buffer. 
		bool sendTX(uint8_t *_dataTX, uint8_t length, uint8_t outLength, bool _wait);
		bool getACK(bool _wait);
		bool waitResponse(bool _wait);
		void getData(uint8_t outLength);
		void checkSum(uint8_t *_dataTX);
		uint8_t lengthCheckSum(uint8_t *_dataTX);
};

#endif

